#pragma once

#include "ALEstd.h"
#include "ProcessManager.h"

enum BaseGameState {
	BGS_Running,
	BGS_Initializing,
	BGS_MainMenu,
};

class BaseGame : IGame
{
protected:
	BaseGameState m_state;
	ProcessManager* m_pProcessManager;
	double m_lifeTime;
	GameViewList m_views;
	ActorMap m_actors;
	//physics
	//random

public:

	BaseGame();
	virtual ~BaseGame();

	virtual bool VPreload() override;
	virtual bool VInit() override;
	virtual bool VLoadGame(const char* levelRes) override;
	virtual void VUpdate(double deltaSecs) override;
	virtual void VRenderViews() override;
	virtual StrongActorPtr VGetActor(const ActorId id) override;
	virtual void VAddActor(StrongActorPtr pActor) override;
	virtual void VRemoveActor(ActorId id) override;

	virtual void VAddView(GameViewPtr pView);
	virtual void VRemoveView(GameViewPtr pView);

	virtual void VChangeState(BaseGameState newState);
	const BaseGameState GetState() const { return m_state; }
};